package com.bwie.service.impl;

import com.bwie.bean.City;
import com.bwie.bean.Shoot;
import com.bwie.bean.Users;
import com.bwie.dao.ShootDao;
import com.bwie.service.ShootService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class ShootServiceImpl implements ShootService {

    @Resource
    private ShootDao shootDao;

    @Override
    public List list(Map map) {
        return shootDao.list(map);
    }

    @Override
    public int dels(String sids) {
        shootDao.delzhong(sids);
        int i=shootDao.dels(sids);
        return i;
    }

    @Override
    public List<Shoot> listshoot() {
        return shootDao.listshoot();
    }

    @Override
    public List<City> listcity(Integer pid) {
        return shootDao.listcity(pid);
    }

    @Override
    public int add(Users users,Integer[] sids) {
       int i= shootDao.add(users);

        Map map = new HashMap();
        map.put("uid",users.getUid());
        map.put("sids",sids);
        shootDao.addzhong(map);

        return i;
    }

    @Override
    public int addps(Shoot shoot) {
        return shootDao.addps(shoot);
    }

    @Override
    public int updaps(Shoot shoot,Integer[]uids) {
        shootDao.delzhong(shoot.getSid()+"");

        int i=shootDao.updaps(shoot);

        Map map = new HashMap();
        map.put("sid",shoot.getSid());
        map.put("uids",uids);
        shootDao.addz(map);

        return i;
    }

    @Override
    public Shoot huips(Integer sid) {
        return shootDao.huips(sid);
    }

    @Override
    public List<Users> listusers() {
        return shootDao.listusers();
    }


}




















